figure.Caudalimetro = new Class({
    Extends: figure.Dial,

    initialize: function(id, css, value, unit, min, capacity, step) {
        this.parent(id, css, value, unit, min, capacity, step);
        this.isOn = false;
        this.controlElement.change({id: id, me: this.controlElement[0], unit: unit}, this.updateDial);
    },

    on: function() {
        this.isOn = true;
    },

    off: function() {
        this.isOn = false;
    },

    addEvents: function() {
        var controlElement = this.controlElement;
        controlElement.on('measure', function measure(event, c) {
            if (figure.stopAnimation) {
                window.setTimeout(function() { measure(event, c) }, figure.speed);
                return;
            }
            var isOn = c.isOn;
            var value = parseFloat(controlElement[0].value);
            if (isOn) {
                if (value < 6.4) {
                    value += 1.6;
                    value = value.toFixed(1);
                    controlElement[0].value = value;
                    controlElement.trigger('change');
                }
            } else {
                value = 0;
                controlElement[0].value = value;
                controlElement.trigger('change');
            }
            window.setTimeout(function() { measure(event, c)}, figure.speed);
        });
    }

});

